/**
 * Extensions.java
 * Version: 1.0
 * Created in 06/08/2013
 * Created by: Gerson Groth
 * 
 * Copyright
 */
package activities.base.tcx;

import java.util.HashMap;
import java.util.Map;

/**
 * The Class Extensions.
 * 
 * @author Gerson Groth
 */
public class Extensions {

	/** The properties. */
	private Map<String, Double> properties = new HashMap<String, Double>();

	/**
	 * Adds the property.
	 * 
	 * @param key
	 *            the key
	 * @param value
	 *            the value
	 */
	public void addProperty(String key, double value) {
		this.properties.put(key, value);
	}

	/**
	 * Adds the property.
	 * 
	 * @param key
	 *            the key
	 * @param value
	 *            the value
	 */
	public void addProperty(String key, int value) {
		addProperty(key, value);
	}

	/**
	 * Adds the property.
	 * 
	 * @param key
	 *            the key
	 * @param value
	 *            the value
	 */
	public void addProperty(String key, String value) {
		double v = Double.parseDouble(value);
		addProperty(key, v);
	}

	/**
	 * Gets the properties.
	 * 
	 * @return the properties
	 */
	public Map<String, Double> getProperties() {
		return this.properties;
	}

	/**
	 * Gets the property.
	 * 
	 * @param key
	 *            the key
	 * @return the property
	 */
	public double getProperty(String key) {
		return this.properties.get(key);
	}
}
